﻿<!--#include file="const.asp"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>


<%
if sid="Null" then
	Response.Redirect "login.asp"
	Response.end
end if
IF  Request.QueryString("Action")="login" Then
	call login
else
	call index
end if
end Function



Function index
	dim page
    		Page = Request("page")      '当前页数
    		If Page = "" Then Page = 1
   		If Not IsNumeric(Page) Then Page = 1
    		Page = CLng(Page)
    		If Page < 1 Then Page = 1
	dim rs,sql,Runtxt,id,topicid
    		topicid = Request("topicid")
    		If topicid = "" Then topicid = 0
   		If Not IsNumeric(topicid) Then topicid = 0
    		topicid = CLng(topicid)
    		If topicid < 0 Then topicid = 0

	Runtxt=qingtian.RunStr
    		id = Request("id")    
    		If id = "" Then id = 1
   		If Not IsNumeric(id) Then id = 1
    		id = CLng(id)
    		If id < 1 Then id = 1

%>
	<card title="删除帖子回复"><p align="left">

		确定删除帖子回复吗?<br/>
    	<a href="delbbsreplist.asp?Action=login&amp;topicid=<%=topicid%>&amp;page=<%=page%>&amp;id=<%=id%>&amp;sid=<%=sid%>">确定删除</a><br/>

-------------<br/>
<a href='bbsreplist.asp?topicid=<%=topicid%>&amp;page=<%=page%>&amp;sid=<%=sid%>'>返回帖子回复管理</a><br/>
<a href='index.asp?sid=<%=sid%>'>后台管理首页</a><br/>
<%
End Function


Function login
	dim page,lid
		lid=0
    		Page = Request("page")      '当前页数
    		If Page = "" Then Page = 1
   		If Not IsNumeric(Page) Then Page = 1
    		Page = CLng(Page)
    		If Page < 1 Then Page = 1

		dim rs,sql,id,i,topicid
    		topicid = Request("topicid")
    		If topicid = "" Then topicid = 0
   		If Not IsNumeric(topicid) Then topicid = 0
    		topicid = CLng(topicid)
    		If topicid < 0 Then topicid = 0


    		id = Request("id")    
    		If id = "" Then id = 1
   		If Not IsNumeric(id) Then id = 1
    		id = CLng(id)
    		If id < 1 Then id = 1

		dim tid
		tid=0
	%>
	<card id="login" title="删除帖子回复" ontimer="bbsreplist.asp?topicid=<%=topicid%>&amp;page=<%=page%>&amp;sid=<%=sid%>"><timer value="20"/>
		<p align="left">
	<%

				set rs=server.CreateObject("adodb.recordset")
				sql="select * from [qingtian_bbs_reforum] WHERE [del]=0  and id="&id
				rs.open sql,conn,1,3
				if not (rs.bof and rs.eof)  then
					tid=rs("topicid")
					rs("del")=1
					rs.update
				rs.update()
				end if
				Rs.close
				set rs=nothing

				set rs=server.CreateObject("adodb.recordset")
				sql="select * from [qingtian_bbs_forum] where id="&tid
				rs.open sql,conn,1,3
				if not (rs.bof and rs.eof)  then
					rs("reply")=rs("reply")-1
					rs.update
				rs.update()
				end if
				Rs.close
				set rs=nothing




		%>删除帖子回复成功!<br/>

<a href='bbsreplist.asp?topicid=<%=topicid%>&amp;page=<%=page%>&amp;sid=<%=sid%>'>返回帖子回复管理</a><br/>
<a href='index.asp?sid=<%=sid%>'>后台管理首页</a><br/>
<%
end Function 


%>
